package src.com.foreknow.demo14;

public class Test {
    public int add(int a,int b )throws CustomException{
        if (a < 0 || b < 0){
            CustomException e = new CustomException();
            throw e;
        }
        return a + b;
    }
    public static void main(String[] args) {
        Test test = new Test();
        try {
            test.add(-1,-2);
        } catch (CustomException e) {
            e.printStackTrace();
        }
    }
}









